#!/bin/bash

. $ZMICRO_HOME/commands/machine/veth/config

xexec() {
  local commands=$@

  sudo ip netns exec $NETWORK_NAMESPACE $commands
}

help() {
  echo "Usage:"
  echo "  zmachine veth exec <commands...>"
  echo ""
}

core() {
  if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "" ]; then
    help
    exit 0
  fi

  xexec $@
}

run() {
  core $@
}

run $@
